Skip to content

fix: keep dropdowns in plugin pages open while their frame grows - #1962

Open
ZacharyZcR wants to merge 1 commit into
Termix-SSH:dev-26.11.4from
ZacharyZcR:fix/frame-select-resize
Open

ZacharyZcR wants to merge 1 commit into
Termix-SSH:dev-26.11.4from
ZacharyZcR:fix/frame-select-resize

Conversation

@ZacharyZcR

Copy link
Copy Markdown
Member

Fixes #1947 and Termix-SSH/Plugin-AI#31

A frame sized to its content grows while a menu is open, so the menu has room (withOpenMenus in frame-root). Growing resizes the frame's window, and Radix Select closes on any window resize, which the other Radix menus don't do. So every Select in a plugin page closed again the moment it opened, and the frame shrank back, which made the page jump. This hits plugin settings, host defaults and the AI plugin's provider and model pickers.

Change

A frame shim, installMenuResizeShim in install-shims.ts, installed next to the form submit shim. It adds the frame's first resize listener. When only the height changed and a Radix popper is open, the resize is the frame making room for the menu, so the shim stops it with stopImmediatePropagation before the menu's own listener sees it. A real resize changes the width too and still closes the menu. With no menu open, every resize passes.

CHANGELOG: a line under 26.11.4 Fixed.

Testing

  • src/ui/tests/plugin-frame/menu-resize.test.ts, with a resize listener standing in for Radix Select's:
    • a height-only resize with a menu open doesn't reach it;
    • a width change does;
    • with no menu open, every resize does.
  • In a browser, on a 26.11.2 container with headless Chromium: Manage → Server host defaults → Terminal → "Connect from (mobile app)", which renders in the ssh-terminal frame.
    • Stock: the listbox is gone again 300 ms after the click.
    • With the same listener added in that frame first: the listbox stays open and its options can be picked.
  • lint and tsc -p tsconfig.app.json are clean. The form submit and frame menu tests still pass.

@termix-triage-bot

Copy link
Copy Markdown

AI review | Looks safe to merge

Adds a resize event shim to keep Radix Select menus open when plugin frames grow vertically to fit them. The implementation correctly filters height-only resizes, includes matching tests, and follows all repository standards with no security or stability risks.

Reviewed 676d3f9. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Open PRs

Development

Successfully merging this pull request may close these issues.

1 participant